//
//  MQRequestTools.h
//  meiquan
//
//  Created by hejingjin on 2017/10/29.
//  Copyright © 2017年 mq. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>
typedef void (^BRTCRequestSuccess)(id json);
typedef void (^BRTCRequestFailure)(NSError *error);
@interface MQRequestTools : NSObject
@property (strong, nonatomic)AFHTTPSessionManager *sessionManager;


@property (strong, nonatomic)AFNetworkReachabilityManager *reachabilityManager;



+ (instancetype)sharedInstance;

-(AFNetworkReachabilityStatus)getnetworkState;

/**
 *  Get网络请求方法
 *
 *  @param method  后半部拼接url
 *  @param params  请求参数
 *  @param success 成功后的回调
 *  @param failure 失败后的回调
 */
+ (void)GETWithMethod:(NSString *)method params:(NSDictionary *)params success:(BRTCRequestSuccess)success failure:(BRTCRequestFailure)failure;


/**
 *  Get网络请求方法
 *
 *  @param method  后半部拼接url
 *  @param params  请求参数
 *  @param success 成功后的回调
 *  @param failure 失败后的回调
 */
+ (void)GETUPWithMethods:(NSString *)method params:(NSDictionary *)params success:(BRTCRequestSuccess)success failure:(BRTCRequestFailure)failure;


/**
 *  POST网络请求方法
 *
 *  @param method  后半部分拼接url
 *  @param params  请求参数
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)POSTWithMethod:(NSString *)method params:(NSDictionary *)params success:(BRTCRequestSuccess)success failure:(BRTCRequestFailure)failure;
@end
